# Maintainer: Christian Hesse <mail@eworm.de>
# Maintainer: Morten Linderud <foxboron@archlinux.org>

pkgname=yubico-pam
_shortname=pam_yubico
pkgver=2.27
pkgrel=2
pkgdesc='Yubico YubiKey PAM module'
arch=('loong64' 'x86_64')
url='https://github.com/Yubico/yubico-pam'
license=('BSD')
depends=('pam' 'yubico-c-client' 'yubikey-personalization' 'json-c')
checkdepends=('perl-net-ldap-server')
provides=("${_shortname}")
conflicts=("${_shortname}")
validpgpkeys=('0A3B0262BCA1705307D5FF06BCA00FD4B2168C0A') # Klas Lindfors <klas@yubico.com>
source=("https://developers.yubico.com/${pkgname}/Releases/${_shortname}-${pkgver}.tar.gz"{,.sig})
sha256sums=('63d02788852644d871746e1a7a1d16c272c583c226f62576f5ad232a6a44e18c'
            'SKIP')

build() {
	cd "${_shortname}-${pkgver}"

	./configure \
		--prefix=/usr
	make
}

check() {
	cd "${_shortname}-${pkgver}"

	make check
}

package() {
	cd "${_shortname}-${pkgver}"

	install -D -m0644 COPYING "${pkgdir}/usr/share/licenses/yubico-pam/COPYING"
	install -D -m0644 README "${pkgdir}/usr/share/doc/yubico-pam/README"
	make DESTDIR="${pkgdir}/" install
}
